Primitive Class Rotation
Represents a 3D rotation.
All angle components are in degrees, automatically clamped to the range [0, 360], excluding raw access.
Members
x | (float) Raw X angle component in degrees. |
y | (float) Raw Y angle component in degrees. |
z | (float) Raw Z angle component in degrees. |
Functions
Rotation(x, y, z) | Create a Rotation object. |
Lerp(rot, alpha) | Get the linearly interpolated Rotation between this Rotation and the input Rotation according to the input alpha. |
Direction() | Get the normalized direction vector of this Rotation. |
Signed() | Get the signed version of this Rotation, clamped to [-180, 180]. |
__tostring(rot) |
Members
- x
- (float) Raw X angle component in degrees. Does not automaticaly clamp to [0, 360].
- y
- (float) Raw Y angle component in degrees. Does not automaticaly clamp to [0, 360].
- z
- (float) Raw Z angle component in degrees. Does not automaticaly clamp to [0, 360].
Functions
- Rotation(x, y, z)
-
Create a Rotation object.
Parameters:
- x float X angle component in degrees.
- y float Y angle component in degrees.
- z float Z angle component in degrees.
Returns:
-
Rotation
A new Rotation object.
- Lerp(rot, alpha)
-
Get the linearly interpolated Rotation between this Rotation and the input Rotation according to the input alpha.
Parameters:
- rot Rotation Interpolation target.
- alpha float Interpolation alpha in the range [0, 1].
Returns:
-
Rotation
Linearly interpolated rotation.
- Direction()
-
Get the normalized direction vector of this Rotation.
Returns:
-
Vec3
Normalized direction vector.
- Signed()
-
Get the signed version of this Rotation, clamped to [-180, 180].
Returns:
-
Rotation
Signed rotation.
- __tostring(rot)
-
Parameters:
- rot Rotation This Rotation.
Returns:
-
string
A string showing the X, Y, and Z angle components of this Rotation.